import { Rule, RuleType } from '@midwayjs/validate';
const requiredString = RuleType.string().required();
export class PatientDTO {
  @Rule(requiredString.min(1).max(128))
  visitCardId: string;
  @Rule(requiredString.min(2).max(128))
  name: string;
  @Rule(requiredString.pattern(/^(MAN|WOMAN)$/i))
  sex: string;
  @Rule(RuleType.number().required().min(0).max(120))
  age: number;
  @Rule(requiredString.length(11))
  phone: string;
}
export class UpdatePatientDTO {
  @Rule(requiredString.min(1).max(200))
  patientId: string;
  @Rule(requiredString.min(2).max(108))
  departmentId: string;
  @Rule(RuleType.string().min(2).max(128))
  visitCardId: string;
  @Rule(RuleType.string().min(2).max(15))
  name: string;
  @Rule(RuleType.string().pattern(/^(MAN|WOMAN)$/i))
  sex: string;
  @Rule(RuleType.number().min(0).max(120))
  age: number;
  @Rule(RuleType.string().length(11))
  phone: string;
  @Rule(RuleType.number().min(0).max(1))
  validFlag: number;
}
